package ch.sv7.tool.dbmanager.db.difference;

import ch.sv7.tool.dbmanager.db.ForeignKeySchema;
import ch.sv7.tool.dbmanager.db.TableSchema;

/**
 *
 * @author svt
 *
 */
public abstract class AbstractForeignKeyDifference extends AbstractTableDifference {

	private ForeignKeySchema actualForeignKey;
	private ForeignKeySchema expectedForeignKey;

	/**
	 * @param tableName
	 */
	public AbstractForeignKeyDifference(TableSchema expectedTableSchema, TableSchema actualTableSchema, ForeignKeySchema expectedForeignKey, ForeignKeySchema actualForeignKey) {
		super(expectedTableSchema, actualTableSchema);
		this.actualForeignKey = actualForeignKey;
		this.expectedForeignKey = expectedForeignKey;
	}

	/**
	 * @see ch.sv7.tool.dbmanager.db.difference.AbstractTableDifference#getMessage()
	 */
	public String getMessage() {
		return super.getMessage() + " foreign key [" + actualForeignKey.getName() + "] ";
	}

	/**
	 * @return the actualForeignKey
	 */
	public ForeignKeySchema getActualForeignKey() {
		return actualForeignKey;
	}

	/**
	 * @return the expectedForeignKey
	 */
	public ForeignKeySchema getExpectedForeignKey() {
		return expectedForeignKey;
	}
		
}
